//
//  editInterCell.m
//  FreeTime
//
//  Created by 王江华 on 16/8/30.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "editInterCell.h"
#import "Header.h"

@implementation editInterCell


+(instancetype)cellWithTableView:(UITableView *)tableView{
    
    static  NSString *cellId=@"editInterCellId";
    editInterCell *cell=[tableView  dequeueReusableCellWithIdentifier:cellId];
    
    if (cell==nil) {
        cell=[[editInterCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
        
    }
    return cell;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{


    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    self.selectionStyle=UITableViewCellSelectionStyleNone;

    self.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    
    if (self) {
        _imageImg=[[UIImageView alloc]init];
        
        _imageImg.contentMode=UIViewContentModeScaleAspectFill;
        _propertyLabel=[[UILabel alloc]init];
        _propertyLabel.font=[UIFont systemFontOfSize:14];
        
        _interestLabel=[[UILabel alloc]init];
        
        _interestLabel.font=[UIFont systemFontOfSize:14];
        
        _lineView=[[UIView alloc]init];
        
        _lineView.backgroundColor=[ImageUtil colorWithRgb:0xe6e6e6];
        
        [self.contentView addSubview:_imageImg];
        
        [self.contentView addSubview:_propertyLabel];
        
        [self.contentView addSubview:_interestLabel];
        
        [self.contentView addSubview:_lineView];
        
    }
    return self;

}
-(void)layoutSubviews{

    [super layoutSubviews];
    
    _imageImg.frame=CGRectMake(10, 10, 20, 20);
    
    _imageImg.centerY=self.contentView.centerY;

    [_propertyLabel sizeToFit];
    
    _propertyLabel.frame=CGRectMake(CGRectGetMaxX(_imageImg.frame)+5, 10, _propertyLabel.frame.size.width, 15);
    
    
    _propertyLabel.centerY=self.contentView.centerY;
    
    
    _lineView.frame=CGRectMake(0, self.contentView.frame.size.height-2, WindowWidth, 1);
    
    
    
    

}






- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
